import os

# 获取当前文件夹路径
folder_path = os.getcwd()

# 要修改的文件后缀
extensions = ('.jpg', '.png')

# 遍历当前文件夹中的所有文件
for filename in os.listdir(folder_path):
    file_path = os.path.join(folder_path, filename)
    if os.path.isfile(file_path) and filename.lower().endswith(extensions):  # 只处理特定后缀的文件
        new_name = "pc-bg-" + filename
        new_file_path = os.path.join(folder_path, new_name)
        os.rename(file_path, new_file_path)
        print(f"Renamed: {filename} -> {new_name}")
